import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @Author: linzp
 * @Date: 2022/10/21/15:52
 */
public class demoStream {


    public static void main(String[] args) {
        Set<String> set = new HashSet<>();
        set.add("a");
        List<Product> list = new ArrayList<>();
        Product product = new Product("a", "1");
        Product product2 = new Product("b", "1");
        list.add(product);
        list.add(product2);
        list.stream().filter(i->(set.contains(i.getName()))).forEach(x->x.setName("aaa"));
        list.forEach(i-> System.out.println(i.getName()));
    }
}
